// let url=window.location .href;
// let temp = url;
// let aa=url.indexOf('=');
// let ss=url.indexOf('&')
// let bb=url.lastIndexOf('=')
// let goodsPrice
// let goodId
// if (aa>-1){
//     goodsPrice=url.substring(aa+1,ss); //获取到商品的id信息
// }
// if (bb>-1){
//     goodId=url.substring(bb+1)
// }

$(function () {
    // console.log(aa)
    // console.log(goodsPrice)
    // console.log(goodId)
    // console.log(JSON.parse(getCookie("stepTwoDetailId")))
    // console.log(JSON.parse(getCookie("stepTwoDetailName")))
    // let temp = JSON.parse(getCookie("stepTwoDetailName"))
    // setCookie('goodsId',goodId)
    // setCookie('goodsPrice',goodsPrice)
    // console.log(decodeURI(temp)) //通过此方法能够将"%E5%A4%A7%E9%99%86%E8%A1%8C%E8%B4%A7"这种形式的码转换为中文编码
    // console.log(URLDecoder.decode(temp,'utf-8'))
    // console.log(getCookie('assessInfoList'))
    $("#pg_price").text(getCookie('goodsPrice'))
    $('#showPhoneImg').prop('src',`http://localhost/images/${getCookie('goodImg')}`)

})
function redirectInfoHtml() {
    window.location.href='http://localhost:8080/html/02-info.html?goodsId='+getCookie('goodsId')
}
function order_submit() {
    let user = getCookie('username')
    console.log(user)
    if(user == ''){
        if (confirm("您还没有登录 是否登录？")){
            window.location.href = 'http://localhost:8080/html/login.html?04-order.html'
        } else {
            alert("您现在没有登录无法下单")
        }
    } else {
        window.location.href = 'http://localhost:8080/html/04-order.html'
    }

    // $.ajax({
    //     url:'http://localhost:8080/order/show',
    //     type: 'post',
    //     contentType:'application/json;charset=UTF-8',
    //     data:{basicInfo:JSON.stringify(assessInfoList),userId:getCookie('username'),goodsId:url},
    // }).then(res => {
    //     console.log(res)
    // })
}
